package com.whw.springboot.walk.controller;


import com.whw.springboot.walk.entity.Message;
import com.whw.springboot.walk.entity.Reback;
import com.whw.springboot.walk.entity.RebackInfo;
import com.whw.springboot.walk.mapper.RebackInfoMapper;
import com.whw.springboot.walk.service.RebackInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "反馈信息模块")
@RestController
@RequestMapping("/api/rebackInfo")
public class RebackInfoController {

    @Resource
    private RebackInfoService rebackInfoService;

    @ApiOperation(value = "添加")
    @PostMapping(value = "/insert")
    public Message insert(RebackInfo rebackInfo){
        return rebackInfoService.insert(rebackInfo);
    }

    @ApiOperation(value = "通过主键删除")
    @DeleteMapping(value = "/deleteByPrimaryKey")
    public Message deleteByPrimaryKey(String rebackInfoId){
        return rebackInfoService.deleteByPrimaryKey(rebackInfoId);
    }

    @ApiOperation(value = "通过主键更新")
    @PutMapping(value = "/updateByPrimaryKey")
    public Message updateByPrimaryKey(RebackInfo rebackInfo){
        return rebackInfoService.updateByPrimaryKey(rebackInfo);
    }

    @ApiOperation(value = "通过主键查询")
    @GetMapping(value = "/findByPrimaryKey")
    public Message<RebackInfo> findByPrimaryKey(String rebackInfoId){
        return  rebackInfoService.findByPrimaryKey(rebackInfoId);
    }

    @ApiOperation(value = "查看所有")
    @GetMapping(value = "/findAll")
    public Message<List<RebackInfo>> findAll(){
        return rebackInfoService.findAll();
    }

    @ApiOperation(value = "通过主键查询反馈和反馈信息")
    @GetMapping(value = "/findRebackAndRebackInfo")
    public Message<List<RebackInfo>> findRebackAndRebackInfo(String rebackRebackId){
        return rebackInfoService.findRebackAndRebackInfo(rebackRebackId);
    }


}
